package pit.com.ordermobilesystem.widget;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;

public class TabViewPaper extends ViewPager {

	boolean disableSwipe=false;
	
	public boolean isDisableSwipe() {
		return disableSwipe;
	}
	public void setDisableSwipe(boolean disableSwipe) {
		this.disableSwipe = disableSwipe;
	}
	public TabViewPaper(Context context, AttributeSet attrs) {
		super(context, attrs);
	}
	    @Override
	    public boolean onTouchEvent(MotionEvent event) {
	        if (disableSwipe) {
	            return false;

	        } else {
	            return super.onTouchEvent(event);
	        }
	    }

	    @Override
	    public boolean onInterceptTouchEvent(MotionEvent event) {
		    if(disableSwipe){
			    return false;
		    }else{
			    return super.onInterceptTouchEvent(event);
		    }
	    }
	    
	    
}
